package com.spring.theory.boot.indexed;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.context.annotation.ClassPathBeanDefinitionScanner;
import org.springframework.stereotype.Component;

/**
 * TestIndexed
 *
 * @author H
 * @version 1.0
 * @date 2024-05-20 10:37
 */
@Slf4j
public class TestIndexed {

    public static void main(String[] args) {
        DefaultListableBeanFactory factory = new DefaultListableBeanFactory();
        ClassPathBeanDefinitionScanner scanner = new ClassPathBeanDefinitionScanner(factory);
        scanner.scan(TestIndexed.class.getPackage().getName());
        for (String d : factory.getBeanDefinitionNames()) {
            log.info("{}", d);
        }

    }

    @Component
    static class IndexedBean1 {
    }

    @Component
    static class IndexedBean2 {
    }

    @Component
    static class IndexedBean3 {
    }

}
